﻿    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="Scripts/jquery-1.7.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        //Agregar -------------------------------------------------------------
        /*$.ajax({
            url: "Services/Auth.svc/UpsertRol",
            type: "POST",
            dataType: "json",
            data: '{"idRol": "-1" ,"prio": 4, "rol":"Prueba" }',
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                if (data) {
                    alert(data);
                }
            },
            error: function () {
                alert('ERROR ');
            }
        }); */

        //Borrar --------------------------------------------------------------
        /*$.ajax({
            url: "Services/Auth.svc/DeleteRol",
            type: "POST",
            dataType: "json",
            data: '{"aIdRol": "20120327170904907"}',
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                if (data) {
                    alert(data);
                }
            },
            error: function (data) {
                alert('Error al borrar Rol ');
            }
        });*/

        //Obtener ------------------------------------------------------------- 
        /*$.ajax({
            url: "Services/Auth.svc/GetDataRol",
            type: "POST",
            dataType: "json",
            //data: '{"aIdRol": null}',
            //data: '{"aIdRol":"20120321152916680,"}',
            //data: '{"aIdRol":"20120321152916680,20120327183419310"}',
            data: '{}',
            //data: '{}',
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                if (data) {
                    alert(data);
                }
            },
            error: function (data) {
                alert('Error al traer Rol ');
            }
        });*/

        //Obtener banco ------------------------------------------------------- 
//        $.ajax({
//            url: "Services/Auth.svc/GetDataRol",
//            type: "POST",
//            dataType: "json",
//            //data: '{"aIdRol": null}',
//            //data: '{"aIdRol":"20120321152916680,"}',
//            //data: '{"aIdRol":"20120321152916680,20120327183419310"}',
//            data: '{}',
//            //data: '{}',
//            contentType: "application/json; charset=utf-8",
//            success: function (data) {
//                if (data) {
//                    alert(data);
//                }
//            },
//            error: function (data) {
//                alert('Error al traer Rol ');
//            }
//        });
        
        //Obtener solicitud --------------------------------------------------- 
        /*$.ajax({
=======
//        $.ajax({
//            url: "Services/Auth.svc/RecuperaTodas",
//            type: "POST",
//            dataType: "json",
//            //data: '{"aIdRol": null}',
//            //data: '{"aIdRol":"20120321152916680,"}',
//            //data: '{"aIdRol":"20120321152916680,20120327183419310"}',
//            data: '{"todas":"true","idStatus":0,"idTipo":0}',
//            //data: '{}',
//            contentType: "application/json; charset=utf-8",
//            success: function (data) {
//                if (data) {
//                    alert(data);
//                }
//            },
//            error: function (data) {
//                alert('Error al traer Rol ');
//            }
//        });

        $.ajax({
            url: "Services/Auth.svc/GetData",
            type: "POST",
            dataType: "json",
            //data: '{"aIdRol": null}',
            //data: '{"aIdRol":"20120321152916680,"}',
            //data: '{"aIdRol":"20120321152916680,20120327183419310"}',
            //data: '{"idCodigoPostal":"52777",}',
              data: '{"idCodigoPostal":null}',
            //data: '{}',
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                if (data) {
                    alert(data);
                }
            },
            error: function (data) {
                alert('Error al traer Rol ');
            }
        });*/

        //ComboBox Datos Bancarios --------------------------------------------
        /*
        $.ajax({
            url: "Services/Auth.svc/GetDataBanco",
            type: "POST",
            dataType: "json",
            data: '{}',
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                alert(data);

            },
            error: function () {
                alert('Error al cargar Datos Bancarios')
            }
        });*/

        //codigoPostal
        /*$.ajax({
            url: "Services/Auth.svc/GetDataEstMunCol",
            type: "POST",
            dataType: "json",
            data: '{"idCodigoPostal":"52777"}',
            contentType: "application/json; charset=utf-8",
            success: function (data) {
            if (data) {
                    alert(data);
                }
                
            },
            error: function () {
                alert('Error al cargar Datos de Codigo Postal')
            }
        });*/

        //Recuperar solicitud Web ---------------------------------------------      
//        $.ajax({
//            url: "Services/Auth.svc/GetDataSolicitudWeb",
//            type: "POST",
//            dataType: "json",
//            data: '{"unidSolicitud":"20120515102840537"}',
//            contentType: "application/json; charset=utf-8",
//            success: function (data) {
//                alert(data);
//                var test = eval('(' + data.GetDataSolicitudWebResult + ')');
//                alert(test.unidSolicitud);
//                console.log(test.docInfo_unidDocInfo);
//            },
//            error: function () {
//                alert('Error al cargar solicitud web')
//            }
//        });
        //Actualizar o insertar solicitud Web ---------------------------------
        //"{'unidSolicitud':'0','docInfo_unidDocInfo':'20120322120447320','docInfo_fechaEnvio':'2012-01-01','docInfo_wUsr':'isaac','docInfo_pcname':'isaac-pc','docInfo_dktVersion':'1010','docInfo_userUltimo':'0101','docInfo_wUsrMail':'isaac@hotmail.com'}"
        /*var id = "{ 'unidSolicitud': '0', 'docInfo_unidDocInfo': '20120322120447320', 'docInfo_fechaEnvio': '2012-01-01', 'docInfo_wUsr': 'prueba', 'docInfo_pcname': 'prueba-pc', 'docInfo_dktVersion': '1010', 'docInfo_userUltimo': '0101', 'docInfo_wUsrMail': 'prueba@hotmail.com' }";

        $.ajax({
            url: "Services/Auth.svc/UpsertWeb",
            type: "POST",
            dataType: "json",
            //data: '{"aIdRol":"20120321152916680,20120327183419310"}',
            //"unidSolicitud":"20120412184709833",
            //"unidSolicitud"
            //"{'datsol_unidTipoSolicitante':'20120321174547020','datsol_isMismoDomicilio':'0','datsol_isProveedor':'1','datsol_isOtrasCategorias':'0','datsol_isOtrosClientes':'1','datsol_idTipoPersonaFiscal':'4','docInfo_fechaEnvio':'2012-01-01','docInfo_wUsr':'isaac','docInfo_pcname':'isaac-pc','docInfo_dktVersion':'1010','docInfo_userUltimo':'0101','docInfo_wUsrMail':'isaac@hotmail.com'}"
            //data:'{"datsol_unidTipoSolicitante":"20120419093014217","datsol_isMismoDomicilio":"1","datsol_isProveedor":"1","datsol_isOtrasCategorias":"1","datsol_isOtrosClientes":"1","datsol_idTipoPersonaFiscal":"4","docInfo_fechaEnvio":"2012-01-01","docInfo_wUsr":"isaac","docInfo_pcname":"isaac-pc","docInfo_dktVersion":"1010","docInfo_userUltimo":"0101","docInfo_wUsrMail":"isaac@hotmail.com"}',
            
            //data: "{'unidSolicitud':'" + id +"'}",

            data: '{"unidSolicitud":" '+ id +'"}',

            contentType: "application/json; charset=utf-8",
            success: function (data) {
                if (data) {
                    alert(data.id);
                }
            },
            error: function () {
                alert('Error al actualizar la solicitud web')
            }
        });*/

        //Recuperar solicitud Web ---------------------------------------------
//        $.ajax({
//            url: "FileServer/FileUploader.cs/ReturnBytesToClient",
        ////////////////////////////// lista de cocumentos
        /*$.ajax({
            url: "Services/Auth.svc/GetDocuments",

//            type: "POST",
//            dataType: "json",
//            data: '{"FileName":"CitasConfirmacion.pdf"}',
//            contentType: "application/json; charset=utf-8",
//            success: function (data) {
//                if (data) {
//                    alert(data);
//                }
//            },
//            error: function () {
//                alert('Error al guardar')
//            }
//        });


        location.href = "DescargaArchivos.aspx";
=======
            type: "POST",
            dataType: "json",
            data: '{"idSolicitud":"20120419112557590"}',
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                if (data) {
                    alert(data);
                }
            },
            error: function () {
                alert('lista de documentos')
            }
        });*/

//        $.ajax({
//            url: "Services/Auth.svc/GetUserRolListRol",
//            type: "POST",
//            dataType: "json",
//            data: '{"idRol":"20120321152916930"}',
//            contentType: "application/json; charset=utf-8",
//            success: function (data) {
//                //                if (data) {
//                //                    alert(data);
//                //                }
//                var test = data.GetUserRolListRolResult.aIdRol;
//                alert(test);
//            },
//            error: function () {
//                alert('Error al cargar user, rol y lista de roles ')
//            }
//        });
//        $.ajax({
//            url: "Services/Auth.svc/GetDataGroupClientes4",
//            type: "POST",
//            dataType: "json",
//            data: '{"idTipoNegocio":"4"}',
//            contentType: "application/json; charset=utf-8",
//            success: function (data) {
//                alert(data);
//                console.log(data.GetDataGroupClientes4Result);
//            },
//            error: function () {
//                alert('Error al traer datos de groupClientes4');
//            }
        //        }); 
        $.ajax({
            url: "Services/Auth.svc/AddGroup",
            type: "POST",
            dataType: "json",
            data: '{"IdRol":"20120000000000003","group.idGroup":27}',
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                alert(data);
                console.log(data.GetDataGroupClientes4Result);
            },
            error: function () {
                alert('Error al traer datos de groupClientes4');
            }
        }); 
    </script>
</head>
<body>
</body>
</html>